<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Login extends CI_Controller {
    
    public function __construct()
    {
            parent::__construct();
            $this->load->model('users_model');
    }    
    
    public function login()
    {     
        
        $builder = new CI_TemplateBuilder();
        $data['title'] = 'Login Page';
        $builder->admin_template_builder('login' , $data);
          
          
    }
    
    public function check_login()
    {             
        $this->load->helper('form');
        $this->load->library('form_validation');

        $this->form_validation->set_rules('username', 'username', 'required');
        $this->form_validation->set_rules('password', 'password', 'required');            
        
        if ($this->form_validation->run() === FALSE)
        {
            $data['title'] = 'Login Page'; 
            $builder->admin_template_builder('login' , $data);
        }
        else
        {
//            if($this->)
            $info = 'Succesfully logged in';
            redirect('admin/'.$info, 'location', 301);
        }           
        
    }
        
        
    
}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */